package com.bjsasc.open.mqtt.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.bjsasc.open.mqtt.service.MqttDataService;

/** 
 * @ClassName: MqttDataServiceImpl 
 * @Description:  将从mqtt服务器中获取到的数据存储到kafka中,这里做数据的业务处理(数据解析和其他业务处理)
 * @author zhangbingbing 
 * @date 2020年4月22日 下午8:40:01 
 * @version 1.0 
 */
@Service("mqttDataService")
public class MqttDataServiceImpl implements MqttDataService {
	
	private static final Logger log = LoggerFactory.getLogger(MqttDataServiceImpl.class);
	
	
    
	@Override
	public void saveMqttData(String s) throws Exception {
		log.info("从EMQ服务器中订阅到的数据为:"  + s);

        try {
                     
            log.info("发送mqttdata成功!"); 
            
            
        } catch (Exception e) {
            log.error("发送kafka失败, {} ", e.getMessage());
        }
		
	}
	

}
